package GUI;

import Kernel.Administrateur;

public class ConsulterTrajet extends javax.swing.JFrame {

	private static final long serialVersionUID = 1923037511252009216L;

	/** Cree une nouvelle instance de ConsulterTrajet */
	public ConsulterTrajet() {
		initComponents();
		this.listingTrajet.setText(Accueil.serveur.toStringTrajet());
		this.setLocationRelativeTo(this.getParent());
	}

	/**
	 * Initialisation des composants d'AWT.
	 */
	private void initComponents() {

		jLabel1 = new javax.swing.JLabel();
		jScrollPane1 = new javax.swing.JScrollPane();
		listingTrajet = new javax.swing.JTextArea();
		retour = new javax.swing.JButton();

		setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

		jLabel1.setText("Trajets");

		listingTrajet.setColumns(20);
		listingTrajet.setRows(5);
		jScrollPane1.setViewportView(listingTrajet);
		listingTrajet.setEditable(false);

		retour.setText("Retour");
		retour.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				retourActionPerformed(evt);
			}
		});

		javax.swing.GroupLayout layout = new javax.swing.GroupLayout(
				getContentPane());
		getContentPane().setLayout(layout);
		layout.setHorizontalGroup(layout
				.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
				.addGroup(
						layout.createSequentialGroup()
								.addGroup(
										layout.createParallelGroup(
												javax.swing.GroupLayout.Alignment.LEADING)
												.addGroup(
														layout.createSequentialGroup()
																.addContainerGap()
																.addComponent(
																		jScrollPane1,
																		javax.swing.GroupLayout.DEFAULT_SIZE,
																		376,
																		Short.MAX_VALUE))
												.addGroup(
														javax.swing.GroupLayout.Alignment.TRAILING,
														layout.createSequentialGroup()
																.addContainerGap(
																		334,
																		Short.MAX_VALUE)
																.addComponent(
																		retour))
												.addGroup(
														layout.createSequentialGroup()
																.addGap(166,
																		166,
																		166)
																.addComponent(
																		jLabel1)))
								.addContainerGap()));
		layout.setVerticalGroup(layout
				.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
				.addGroup(
						layout.createSequentialGroup()
								.addContainerGap()
								.addComponent(jLabel1)
								.addGap(12, 12, 12)
								.addComponent(jScrollPane1,
										javax.swing.GroupLayout.PREFERRED_SIZE,
										188,
										javax.swing.GroupLayout.PREFERRED_SIZE)
								.addPreferredGap(
										javax.swing.LayoutStyle.ComponentPlacement.RELATED,
										30, Short.MAX_VALUE)
								.addComponent(retour).addContainerGap()));

		pack();
	}

	private void retourActionPerformed(java.awt.event.ActionEvent evt) {
		Administration at = new Administration(new Administrateur(Administration.admin.getLogin(), Administration.admin.getPassword(), Accueil.serveur));
		at.setVisible(true);
		this.setVisible(false);
		this.dispose();
	}

	private javax.swing.JLabel jLabel1;
	private javax.swing.JScrollPane jScrollPane1;
	private javax.swing.JTextArea listingTrajet;
	private javax.swing.JButton retour;

}
